import React from 'react';
import {Link, NavLink, Route, Router, Switch, routerRedux} from 'dva/router';
import {PATH_HOME} from './utils/constant';
import  {connect} from  'dva'
import App from './routes/app/APPContainer';


import {Button} from 'antd-mobile'

import AppIndex from './routes/app/AppIndex';
import AppRecharge from './routes/app/AppRecharge';
import MenuIndex from './routes/app/MenuIndex';
import NotFound from './routes/app/NotFound';

const BasePath = `${PATH_HOME}app`;

const Main = ({history}) => {
  return <App>
    <Router history={history}>
      <div>
        <Switch>
          <Route path={BasePath + '/index'} component={AppIndex}/>
          <Route path={BasePath + '/menu'} component={MenuIndex}/>
          <Route path={BasePath + '/test'} component={AppRecharge}/>
          <Route component={NotFound}/>
        </Switch>
      </div>
    </Router>
  </App>;
};


// export default connect(state => state.login)(main)

export default Main;
